/**
 * @author 汪孟苹
 */
define([],function(){
	var tpl = {};
	tpl.init1 = function(){
		var html = '';
		html += list();
		return html;
	}
	tpl.init2 = function(){
		var html = '';
		html += datailInfo();
		return html;
	}
	tpl.init3 = function(){
		var html = '';
		html += listDay();
		return html;
	}
	tpl.init4 = function(){
		var html = '';
		html += userInfo();
		return html;
	}
	var userInfo = function(){
		return 	'<script id="tpl_userinfo" type="text/html">'+
				'{{list}}'+
				'<div>'+
				'{{if gender=="F"}}'+
				'<i class="fa fa-female" aria-hidden="true"></i>'+
				'{{else if gender=="N"}}'+
				'<i class="fa fa-male" aria-hidden="true"></i>'+
				'{{/if}}'+
				'</div>'+
				'<div>'+
				'<font class="oxygen-username">{{username}}</font>'+
				'<br/>'+
				'<font class="oxygen-birthday">生日：{{birthday}}</font>'+
				'</div>'
	}
	var list = function(){
		return 	'<script id="tpl_oxygen_list" type="text/html">'+
				'	<div class="top-nav">监测记录'+
			    '   </div>'+
			    '	{{each rows as value i}}'+
			   	'   <div class="bottom-con" oxygenPulserateId="{{value.oxygenPulserateId}}">'+
			   	'       <p><i class="fa fa-calendar-o bf" aria-hidden="true"></i>{{value.startTime}}</p>'+
			    '  		<p><i class="fa fa-clock-o bf" aria-hidden="true"></i>{{value.timeLong}}</p>'+
			   	'   </div>'+
			   	'	{{/each}}'+
		        '<script>';
	}
	var listDay = function(){
		return 	'<script id="tpl_oxygen_listDay" type="text/html">'+
			'	<div class="top-nav">监测记录'+
			'   </div>'+
			'	{{each rows as value i}}'+
			'   <div class="historyday bottom-con" userId="{{value.userId}}">{{value.testTime}}</div>'+
			'	{{/each}}'+
			'<script>';
	}
	var datailInfo = function(){
		return 	'<script id="tpl_oxygen_datailInfo" type="text/html">'+
				'	{{each rows as value i}}'+
				'		<div class="details f_left">'+
		        '            <div class="con-p">'+
		        '                <p>监测时间：{{value.testTime}}</p>'+
		        '                <p>监测时长：{{value.timeLong}}</p>'+
		        '                <p>氧饱正常范围：{{value.oxygenalarmLower}}~{{value.oxygenalarmTop}}</p>'+
		        '            </div>'+
		        '            <div class="form clearfix">'+
		        '                <div>'+
		        '                    <div  class="bgc-1">'+
		        '                        <h3>{{value.oxygenValueMax}}</h3>'+
		        '                        <p>氧饱（%）</p>'+
		        '                    </div>'+
		        '                    <span>最高值</span>'+
		        '                </div>'+
		        '                <div>'+
		        '                    <div  class="bgc-2">'+
		        '                        <h3>{{value.oxygenValueMin}}</h3>'+
		        '                        <p>氧饱（%）</p>'+
		        '                    </div>'+
		        '                    <span>最低值</span>'+
		        '                </div>'+
		        '                <div>'+
		        '                    <div  class="bgc-3">'+
		        '                        <h3>{{value.oxygenValueFinal}}</h3>'+
		        '                        <p>氧饱（%）</p>'+
		        '                    </div>'+
		        '                    <span>最终值</span>'+
		        '                </div>'+
		        '            </div>'+
		        '        </div>'+
		        '        <div class="details f_left">'+
		        '            <div class="con-p">'+
		        '                <p>监测年龄：{{value.weekAge}}周龄</p>'+
		        '                <p>患者类型：{{value.userType}}</p>'+
		        '                <p>脉率常范围：{{value.ratearmLower}}-{{value.ratearmTop}}BPM</p>'+
		        '            </div>'+
		        '            <div class="form clearfix">'+
		        '                <div>'+
		        '                    <div class="bgc-4">'+
		        '                        <h3>{{value.pulseValueMax}}</h3>'+
		        '                        <p>脉率（bpm）</p>'+
		        '                    </div>'+
		        '                    <span>最高值</span>'+
		        '                </div>'+
		        '                <div>'+
		        '                    <div class="bgc-5">'+
		        '                        <h3>{{value.pulseValueMin}}</h3>'+
		        '                        <p>脉率（bpm）</p>'+
		        '                    </div>'+
		        '                    <span>最低值</span>'+
		        '                </div>'+
		        '                <div>'+
		        '                    <div class="bgc-6">'+
		        '                        <h3>{{value.pulseValueFinal}}</h3>'+
		        '                        <p>脉率（bpm）</p>'+
		        '                    </div>'+
		        '                    <span>最终值</span>'+
		        '                </div>'+
		        '            </div>'+
		        '        </div>'+
                '	{{/each}}'+
		        '<script>';
	}
	return tpl;
});